]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
pointerA11yTimeout: Draw a clean circle if the pie is finished
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 22 Aug 2019 08:05:40 +0000 (10:05 +0200)
committerOlivier Fourdan <ofourdan@redhat.com>
Tue, 27 Aug 2019 08:03:49 +0000 (08:03 +0000)
If the circle is complete and the pie timeout finished, we don't need
the lines to the center point indicating the ends of the pie anymore.
We just draw a clean circle instead, which allows for a zoom-out and
fade animation of the circle when we're done.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/688

js/ui/pointerA11yTimeout.js

index 5744ac300d053146bea7086b1ed47882236f6ca0..d285ccf2adcec243c5337a5f973350169a5d78a5 100644 (file)
@@ -50,9 +50,14 @@ var PieTimer = GObject.registerClass({
         cr.setLineJoin(Cairo.LineJoin.ROUND);
         cr.translate(width / 2, height / 2);
 
-        cr.moveTo(0, 0);
+        if (this._angle < 2 * Math.PI)
+            cr.moveTo(0, 0);
+
         cr.arc(0, 0, radius - borderWidth, startAngle, endAngle);
-        cr.lineTo(0, 0);
+
+        if (this._angle < 2 * Math.PI)
+            cr.lineTo(0, 0);
+
         cr.closePath();
 
         cr.setLineWidth(0);